<%@page import="com.kaishengit.entity.CarItem"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'order.jsp' starting page</title>
   </head>
  
  <body>
    <h3>收货信息</h3>
    <form action="addorder.jspx" method="post">
    	收货人：<input type="text" name="name"/><br/>
    	联系电话：<input type="text" name="tel"/><br/>
    	地址：<input type="text" name="address"/><br/>
    	<input type="submit" name="提交表单"/><br/>
    </form>
    <hr/>
    <h3>订单信息</h3>
    <a href="shopcar.jspx">返回购物车修改</a>
    <%
    	List<CarItem> list=(List<CarItem>)session.getAttribute("shopCar");
     %>
     <table border="1" width="70%">
     	<tr>
     		<th>商品名称</th>
     		<th>商品单价</th>
     		<th>数量</th>
     		<th>总价</th>
     	</tr>
     <%
     		float total=0f;
     		if(list==null||list.isEmpty()){
     			response.sendRedirect("prod.jspx");
     			return;
     		}else{
     			for(CarItem item:list){
     				total+=item.getTotal();
     			 %>
     <tr>
     	<td><%=item.getProd().getProdName()%></td>
     	<td><%=item.getProd().getPrice()%></td>
     	<td><%=item.getNum()%></td>
     	<td>￥<%=item.getTotal()%></td>
     
     </tr>			 
     		<%} } %>
     	
     	
     	
     </table>
    
    <h3>共支付：￥<%=total %>元</h3>
  </body>
</html>
